import { Redirect } from 'react-router-dom';
import Home from '../view/Home';
import About from '../components/About';
import A from '../view/A';
import B from '../view/B';
import NotFound from '../components/NotFound/inex.jsx';

const routes = [
    {
        path: '/',
        component: Home,
        exact: true,
    },
    {
        path: "/about",
        component: About,
        routes: [
          {
            path:'/about',
            exact: true,
            render:()=>{
                return <Redirect to={'/about/a'}></Redirect>
            }
          },
          {
            path: "/about/a",
            component: A
          },
          {
            path: "/about/b",
            component: B
          },
          {
            path: '/about/*',
            component: NotFound,
          },
        ]
      },
      {
        path: '*',
        component: NotFound,
      },
];

export default routes;
